home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 62 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: lyra.csx.cam.ac.uk!nmm1
  2. From: nmm1@cus.cam.ac.uk (Nick Maclaren)
  3. Newsgroups: comp.std.c
  4. Subject: Re: sizeof(1L) in preprocesor;How to tell sizeof(double)>sizeof(long) ?
  5. Date: 9 Jan 1996 13:13:03 GMT
  6. Organization: University of Cambridge, England
  7. Message-ID: <4ctpkv$82v@lyra.csx.cam.ac.uk>
  8. References: <sc3f9vb6gk.fsf@lns101.lns.cornell.edu> <1996Jan5.094122.16151@sq.com>  <vyzd98ug7w4.fsf@lamothe.informatik.uni-dortmund.de>  <tuent98zl4.fsf@nemo.bedford.waii.com> <4ctk66$57j@lyra.csx.cam.ac.uk> <KANZE.96Jan9135752@slsvewt.lts.sel.alcatel.de>
  9. NNTP-Posting-Host: ursa.cus.cam.ac.uk
  10.  
  11. In article <KANZE.96Jan9135752@slsvewt.lts.sel.alcatel.de>, kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
  12. |> In article <4ctk66$57j@lyra.csx.cam.ac.uk> nmm1@cus.cam.ac.uk (Nick
  13. |> Maclaren) writes:
  14. |> 
  15. |> |> Don't bother - the 'constants' in <float.h> aren't!  This is a specific
  16. |> |> exclusion to make life easier for systems with separate floating-point
  17. |> |> processors, and makes <float.h> almost useless for numerical analysts.
  18. |> 
  19. |> |> I tried to get this imbecility (and it IS an imbecility) fixed, but I
  20. |> |> failed.  So any portable library of mathematical functions has to define
  21. |> |> its own system-dependent constants, and can use <float.h> only for
  22. |> |> comparison :-(
  23. |> 
  24. |> Is this true for all of the ``constants'' in float.h, or only some of
  25. |> them?  I don't have my C standard here to check, but I thought that
  26. |> this was only true of the constants whose type was non-integral.
  27.  
  28. All except FLT_RADIX.  The reason for this is probably that Intel and
  29. similar chips work in only one radix, but most other properties can be
  30. set dynamically.  However, there is no fundamental reason why FLT_RADIX
  31. should be fixed or, indeed, the same for all precisions.
  32.  
  33. Incidentally, I don't know of any systems which actually USE dynamic
  34. values - all of the ones that I have tried used fixed values in <float.h>
  35. even though they don't all use preprocessor constants for all values.
  36.  
  37.  
  38. Nick Maclaren,
  39. University of Cambridge Computer Laboratory,
  40. New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
  41. Email:  nmm1@cam.ac.uk
  42. Tel.:  +44 1223 334761    Fax:  +44 1223 334679
  43.